module.exports = app => {
  const { STRING, INTEGER, DATE } = app.Sequelize;

  const Banner = app.model.define('banner', {
    id: { type: INTEGER, primaryKey: true, autoIncrement: true },
    imageUrl: { type: STRING(255), allowNull: false, comment: '图片URL' },
    title: { type: STRING(100), comment: '标题' },
    link: { type: STRING(255), comment: '链接URL' },
    sort: { type: INTEGER, defaultValue: 0, comment: '排序' },
    status: { type: INTEGER, defaultValue: 1, comment: '状态：0-禁用，1-启用' },
    createdAt: DATE,
    updatedAt: DATE,
  });

  return Banner;
};
